#include <iostream>
#include <fstream>
#include <string>
using namespace std;
#include "LuaParser.h"

int main()
{
	cout<<"Loading"<<endl;
	ifstream inFile;
	inFile.open("./main.lua");
	if (!inFile) 
	{
    	cerr << "Unable to open file main.lua";
    	exit(1); 
	}
	string content;
	inFile.seekg(0, std::ios::end);
	content.resize(inFile.tellg());
    inFile.seekg(0, std::ios::beg);
    inFile.read(&content[0], content.size());
	inFile.close();
	LuaParser * parser = new LuaParser();
	parser->parseData(content);
	string html = parser->getHtml();
	ofstream outFile;
	outFile.open("page.html");
	outFile << html;
	outFile.close();
	delete parser;
	return 0;
}